package com.app.project.service;

import com.app.project.model.dto.file.ChunkUploadRequest;
import com.app.project.model.dto.file.MergeChunkRequest;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

public interface BigFileUploadService {

    /**
     * 检查文件上传状态
     *
     * @param fileHash 文件 hash
     * @param userId   用户 id
     * @return 文件上传状态
     */
    Map<String, Object> checkFileStatus(String  fileHash, Long userId);

    /**
     * 上传分片
     * @param chunkUploadRequest
     * @param chunkFile
     * @param userId
     */
    Boolean uploadChunk(ChunkUploadRequest chunkUploadRequest, MultipartFile chunkFile, Long userId);
    Boolean uploadChunkLocal(ChunkUploadRequest chunkUploadRequest, MultipartFile chunkFile, Long userId);

    /**
     * 合并分片
     * @param mergeChunkRequest
     * @param userId
     */
    String mergeChunks(MergeChunkRequest mergeChunkRequest, Long userId);
    String mergeChunksLocal(MergeChunkRequest mergeChunkRequest, Long userId);
}
